package com.slz3.business.module.systemManagement.sysRole.steward;

import com.slz3.business.module.systemManagement.sysRole.domain.SysRole;
import com.slz3.business.module.systemManagement.sysRole.domain.SysRoleCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysRoleResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysRole.class).flatMap(sysRole ->
                SysRoleResController.add(req, sysRole)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.delete(req, sysRoleCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysRole.class).flatMap(sysRole ->
                SysRoleResController.modify(req, sysRole)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return SysRoleResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return SysRoleResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return SysRoleResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.auditSubmit(req, sysRoleCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.audit(req, sysRoleCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.auditReject(req, sysRoleCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.usingEnable(req, sysRoleCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysRoleCondition.class).flatMap(sysRoleCondition ->
                SysRoleResController.usingDisable(req, sysRoleCondition)
        );
    }   

}
